<?php
header("Pragma: public");
header("Expires: 0");
header("Accept-Ranges: bytes");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/vnd.ms-excel");
header('Content-Disposition: attachment; filename=otchet.xls');
header("Content-Transfer-Encoding: binary"); 
?>
<table border=1>
<?php
/* foreach ($abiturients as $abiturient):
echo '<tr>';	
echo '<td>';
	echo $professions[$abiturient['Enrolledstudent'][0]['profession_id']];
echo '</td>';
echo '<td>';
	echo $abiturient['Abiturient']['lastname'].' '.$abiturient['Abiturient']['firstname'].' '.$abiturient['Abiturient']['surname'];
echo '</td>';
echo '<td>';
echo $abiturient['Gender']['name'];
echo '</td>';
echo '<td>';
	echo $abiturient['Abiturient']['birthdate'];
echo '</td>';
echo '<td>';
	echo $abiturient['Abiturient']['passport_ser'].' '.$abiturient['Abiturient']['passport_num'].' '.$abiturient['Abiturient']['passport_issuedate'].' '.$abiturient['Abiturient']['passport_data'];
echo '</td>';
echo '<td>';
echo $abiturient['Abiturient']['adress'];
echo '</td>';	
echo '</tr>';	
endforeach; */
echo '<tr>';
echo '<th>';
echo 'Целевая Организация';
echo '</th>';
echo '<th>';
echo 'кол-во целевых';
echo '</th>';
echo '</tr>';

	foreach ($results as $result):
	echo '<tr>';
	echo '<td>';
		echo $result['name'];
	echo '</td>';
	echo '<td align=center>';
		echo $result['count'];
	echo '</td>';	
	echo '</tr>';
	endforeach;
?>
</table>